<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>数据库权限管理</title>
<link href="../css/css.css" rel="stylesheet" type="text/css" />
</head>
<body>
<script type="text/javascript" src="/javascript/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="/javascript/template.js?2"></script>
<script type="text/javascript" src="/javascript/jquery-ui.min.js"></script>
<script type="text/javascript" src="/javascript/jquery.multiselect.js"></script>
<link type="text/css" href="/css/jquery.multiselect.css" rel="stylesheet" />
<link type="text/css" href="/css/jquery-ui.css" rel="stylesheet" />
<script>
    
    $(function(){
        if($("#massage").val().length > 0)
            alert($("#massage").val());
         var oldered="";
         var oldpriv=$("#oldpriv").val();
         $("[name='priviledge']").each(function(){
              var value=$(this).val();
              if(oldpriv.indexOf(value) >= 0){
                  $(this).attr("checked",true);
                  oldered+=","+value;
               }
         });
        $("#oldpriv").val(oldered);
        $("[name='priviledge']").click(function(){
            var privs="";
            $("[name='priviledge']").each(function(){
                var val=$(this).attr("value");
                if($(this).attr("checked"))
                    privs+=","+val;
            });
            $("#priv").val(privs);
        });
    });
    
    
</script>

<div class="lr_both">
<div class="right_conts">
  <div class="mg_tt">
    <div class="right_search">
      <div class="rs_title_bg">
        <h2 class="rs_title">数据库权限编辑</h2>
      </div>
      </br>
      <form id="addPriv" name="addPriv" action="/dbmanager/update" method="post">
       <table class="sj_tl"  width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <th align="center" colspan="2">用户基本信息</th>
        </tr>
        <tr>
           <td align="center" >用户名称</td>
          <td align="center"  ><input type="text"  readonly="readonly" name="username" id="username" value="$!{username}"/></td>
            <td align="left">
                <input type="hidden" name="oldpriv" id="oldpriv" value="$!{oldpriv}"/>
                <input type="hidden" name="massage" id="massage" value="$!{massage}"/>
            </td>
        </tr>
     </table>
     
      <div style="background:#e3eba6;padding-top:10px;padding-left: 22px;padding-bottom:10px">
        <div class="pd_text">主机:</div>
        <div class="input_div">
           <input  class="input_text" readonly="readonly" name="hostname" id="hostname" type="text" value="$!{hostname}"/>
        </div>
        <div class="pd_text">数据库</div>
        <div class="input_div">
            <input  class="input_text" readonly="readonly" name="dbname" id="dbname" type="text" value="$!{dbname}"/>
        </div>
         <div class="pd_text">数据表</div>
        <div class="input_div">
          <input  class="input_text" readonly="readonly" name="tablename" id="tablename" type="text" value="$!{tablename}"/>
        </div>
        &nbsp;&nbsp;&nbsp;&nbsp;
        <input type="submit" name="add" id="add" value="提交"/>
        </div>
        
        <div style="background:#e3eba6;padding-top:5px;padding-left: 30px;padding-bottom:10px">
         <label>权限:</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <input type="hidden" name="priv" id="priv" value=""/>  
        <input type="checkbox" name="priviledge" id="select" value="select" >select</input>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <input type="checkbox" name="priviledge" id="insert" value="insert" >insert</input>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <input type="checkbox" name="priviledge" id="update" value="update" >update</input>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <input type="checkbox" name="priviledge" id="delete" value="delete" >delete</input>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <input type="checkbox" name="priviledge" id="drop" value="drop" >drop</input>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      </div>
        
       </form>
    </div>

  </div>
</div>
</div>
</body>
</html>
